package com.alogic.pipeline;

import com.anysoft.util.Properties;

/**
 * 流水线监听器
 *
 * @since 1.6.13.35 [20210218 duanyy] <br>
 */
public interface PipelineListener {

    /**
     * 作业是否被取消了
     * @param jobId 作业id
     * @return 是否已经取消
     */
    public boolean isCanceled(String jobId);

    /**
     * 获取一个新的id
     * @return 新的id
     */
    public String newId();

    public void onCreate(String jobId, Properties ctx);

    public void onStart(String jobId, Properties ctx);

    public void onFinish(String jobId, Properties ctx);

    public void onCreate(String jobId,String stageId,Properties ctx);

    public void onStart(String jobId,String stageId,Properties ctx);

    public void onFinish(String jobId,String stageId,Properties ctx);

    public void onCreate(String jobId,String stageId,String stepId,Properties ctx);

    public void onStart(String jobId,String stageId,String stepId,Properties ctx);

    public void onFinish(String jobId,String stageId,String stepId,Properties ctx);
}
